#!/bin/bash

echo "==============================================="
echo "  Spring Boot + RustFS 文件管理系统"
echo "==============================================="
echo ""

echo "[1/2] 正在编译项目..."
mvn clean package -DskipTests

if [ $? -ne 0 ]; then
    echo ""
    echo "❌ 编译失败！请检查错误信息。"
    exit 1
fi

echo ""
echo "[2/2] 正在启动应用..."
echo ""
echo "✅ 应用启动成功！"
echo "📝 访问地址: http://localhost:8080"
echo ""
echo "按 Ctrl+C 停止应用"
echo "==============================================="
echo ""

mvn spring-boot:run

